<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-JAVA: awtk.TGuage类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-JAVA
   </div>
   <div id="projectbrief">AWTK JAVA API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>awtk</b></li><li class="navelem"><a class="el" href="classawtk_1_1_t_guage.html">TGuage</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="classawtk_1_1_t_guage-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">awtk.TGuage类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 awtk.TGuage 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classawtk_1_1_t_guage.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ad32d5a7ea59ea8cd38e40c8d7685f2e6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_guage.html#ad32d5a7ea59ea8cd38e40c8d7685f2e6">TGuage</a> (long nativeObj)</td></tr>
<tr class="separator:ad32d5a7ea59ea8cd38e40c8d7685f2e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6506cdd34ba39a3fae00b4127d0bff4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_guage.html#aa6506cdd34ba39a3fae00b4127d0bff4">setImage</a> (String name)</td></tr>
<tr class="separator:aa6506cdd34ba39a3fae00b4127d0bff4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1fa4414d86c9a0a36f944288bbf8b9b5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_guage.html#a1fa4414d86c9a0a36f944288bbf8b9b5">setDrawType</a> (<a class="el" href="enumawtk_1_1_t_image_draw_type.html">TImageDrawType</a> draw_type)</td></tr>
<tr class="separator:a1fa4414d86c9a0a36f944288bbf8b9b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0335226608671121e0cdca81b05c8e4"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_guage.html#af0335226608671121e0cdca81b05c8e4">getImage</a> ()</td></tr>
<tr class="separator:af0335226608671121e0cdca81b05c8e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa2646b116f5caa9e011a491144e2fe4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_image_draw_type.html">TImageDrawType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_guage.html#aaa2646b116f5caa9e011a491144e2fe4">getDrawType</a> ()</td></tr>
<tr class="separator:aaa2646b116f5caa9e011a491144e2fe4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a7db67a17578e1f810bed9122542b6160"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_t_guage.html">TGuage</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_guage.html#a7db67a17578e1f810bed9122542b6160">cast</a> (long nativeObj)</td></tr>
<tr class="separator:a7db67a17578e1f810bed9122542b6160"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a50b254e4196ec1fb3739ac442e19b9c6"><td class="memItemLeft" align="right" valign="top">static TWidget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_guage.html#a50b254e4196ec1fb3739ac442e19b9c6">create</a> (TWidget parent, int x, int y, int w, int h)</td></tr>
<tr class="separator:a50b254e4196ec1fb3739ac442e19b9c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7579088dfbf766b308b79b0bd97511d7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_t_guage.html">TGuage</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_guage.html#a7579088dfbf766b308b79b0bd97511d7">cast</a> (TWidget widget)</td></tr>
<tr class="separator:a7579088dfbf766b308b79b0bd97511d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>表盘控件。</p>
<p>表盘控件就是一张图片。</p>
<p>guage_t是widget\_t的子类控件，widget_t的函数均适用于guage_t控件。</p>
<p>在xml中使用"guage"标签创建表盘控件。如：</p>
<div class="fragment"><div class="line">*&lt;<span class="keywordtype">guage</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;c&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;10&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;240&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;240&quot;</span> <span class="keyword">image</span>=<span class="stringliteral">&quot;guage_bg&quot;</span></div>
</div><!-- fragment --><blockquote class="doxtable">
<p>更多用法请参考： </p>
</blockquote>
<p><a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/guage.xml">guage.xml</a></p>
<p>在c代码中使用函数guage_create创建表盘控件。如：</p>
<p>可用通过style来设置控件的显示风格，如背景和边框等。如：</p>
<div class="fragment"><div class="line">*&lt;<span class="keywordtype">guage</span>&gt;</div>
<div class="line">*&lt;<span class="keywordtype">style</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;border&quot;</span>&gt;</div>
<div class="line">*&lt;<span class="keywordtype">normal</span> <span class="keyword">border_color</span>=<span class="stringliteral">&quot;#000000&quot;</span> <span class="keyword">bg_color</span>=<span class="stringliteral">&quot;#e0e0e0&quot;</span> <span class="keyword">text_color</span>=<span class="stringliteral">&quot;black&quot;</span>/&gt;</div>
<div class="line">*&lt;/<span class="keywordtype">style</span>&gt;</div>
<div class="line">*&lt;/<span class="keywordtype">guage</span>&gt;</div>
</div><!-- fragment --><blockquote class="doxtable">
<p>更多用法请参考： </p>
</blockquote>
<p><a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/styles/default.xml">theme default</a> </p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="ad32d5a7ea59ea8cd38e40c8d7685f2e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad32d5a7ea59ea8cd38e40c8d7685f2e6">&#9670;&nbsp;</a></span>TGuage()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">awtk.TGuage.TGuage </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>nativeObj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>通过nativeObj构造Java对象。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">nativeObj</td><td>原生对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的Java对象。 </dd></dl>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a7db67a17578e1f810bed9122542b6160"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7db67a17578e1f810bed9122542b6160">&#9670;&nbsp;</a></span>cast() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_t_guage.html">TGuage</a> awtk.TGuage.cast </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>nativeObj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>把nativeObj转换层Java对象。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">nativeObj</td><td>原生对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的Java对象。 </dd></dl>

</div>
</div>
<a id="a7579088dfbf766b308b79b0bd97511d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7579088dfbf766b308b79b0bd97511d7">&#9670;&nbsp;</a></span>cast() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_t_guage.html">TGuage</a> awtk.TGuage.cast </td>
          <td>(</td>
          <td class="paramtype">TWidget&#160;</td>
          <td class="paramname"><em>widget</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>转换为guage对象(供脚本语言使用)。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">widget</td><td>guage对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>guage对象。 </dd></dl>

</div>
</div>
<a id="a50b254e4196ec1fb3739ac442e19b9c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a50b254e4196ec1fb3739ac442e19b9c6">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static TWidget awtk.TGuage.create </td>
          <td>(</td>
          <td class="paramtype">TWidget&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建guage对象</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="aaa2646b116f5caa9e011a491144e2fe4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa2646b116f5caa9e011a491144e2fe4">&#9670;&nbsp;</a></span>getDrawType()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_image_draw_type.html">TImageDrawType</a> awtk.TGuage.getDrawType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>图片的绘制方式。 </p>

</div>
</div>
<a id="af0335226608671121e0cdca81b05c8e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af0335226608671121e0cdca81b05c8e4">&#9670;&nbsp;</a></span>getImage()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">String awtk.TGuage.getImage </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>背景图片。 </p>

</div>
</div>
<a id="a1fa4414d86c9a0a36f944288bbf8b9b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1fa4414d86c9a0a36f944288bbf8b9b5">&#9670;&nbsp;</a></span>setDrawType()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TGuage.setDrawType </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="enumawtk_1_1_t_image_draw_type.html">TImageDrawType</a>&#160;</td>
          <td class="paramname"><em>draw_type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>设置图片的显示方式。</p>
<blockquote class="doxtable">
<p>绘制方式的属性值和枚举值: </p>
</blockquote>
<p><a href="https://github.com/zlgopen/awtk/blob/master/src/base/enums.c#L98">image_draw_type_name_value</a></p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">draw_type</td><td>显示方式。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="aa6506cdd34ba39a3fae00b4127d0bff4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa6506cdd34ba39a3fae00b4127d0bff4">&#9670;&nbsp;</a></span>setImage()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TGuage.setImage </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>设置背景图片的名称。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>图片名称，该图片必须存在于资源管理器。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/TGuage.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
